package C05B;

public class Student extends Person{
    private int no;
    private double scoreEn;
    private double scoreMath;
    private double scoreCn;

    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public double getScoreEn() {
        return scoreEn;
    }

    public void setScoreEn(double scoreEn) {
        this.scoreEn = scoreEn;
    }

    public double getScoreMath() {
        return scoreMath;
    }

    public void setScoreMath(double scoreMath) {
        this.scoreMath = scoreMath;
    }

    public double getScoreCn() {
        return scoreCn;
    }

    public void setScoreCn(double scoreCn) {
        this.scoreCn = scoreCn;
    }
    public double aver(){
        return(scoreCn+scoreEn+scoreMath)/3;
    }
    public double max(){
        return Math.max(Math.max(scoreMath,scoreEn),scoreCn);
    }
    public double min(){
        return Math.min(Math.min(scoreMath,scoreEn),scoreCn);
    }

    @Override
    public String toString() {
        return "Student{" +
                "学号：" + no +
                "英语成绩：" + scoreEn +
                "数学成绩：" + scoreMath +
                "语文成绩：" + scoreCn +
                "姓名：" + name + '\'' +
                "年龄:" + age +
                "性别；" +
                "" + sex + '\'' +
                '}';
    }
}
